package com.geese.module.ceo.dao;

import java.util.List;

import com.geese.module.admin.vo.OrderVO;
import org.apache.ibatis.annotations.Param;

import com.geese.common.entity.Order;
import com.geese.module.business.vo.OrderBusinessQuery;
import com.geese.module.ceo.vo.OrderCeoQuery;
import com.geese.module.wechat.vo.CourierOrderVO;
import com.geese.module.wechat.vo.ShopkeeperOrderVO;

public interface OrderMapper {
    int insert(Order record);

    int insertSelective(Order record);

    Order selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Order record);

    List<Order> selectOrderForCourier(CourierOrderVO courierOrderVO);

    List<Order> selectOrderForShopkeeper(ShopkeeperOrderVO shopkeeperOrderVO);

    /**
     * CEO获取订单列表
     */
	List<Order> listAllByCeo(@Param("query")OrderCeoQuery query, @Param("schoolId")Integer schoolId);

	/**
	 * 商家端获取订单列表
	 */
	List<Order> listAllByBusiness(@Param("query") OrderBusinessQuery query, @Param("businessId") Integer businessId);

    /**
     * 根据code获取订单信息
     * @param orderCode
     * @return
     */
    Order selectByOrderCode(@Param("code") int orderCode);

    /**
     * 根据商家ids获取所有订单
     * @param businessIds
     * @return
     */
    List<Order> selectOrderByBusinessIds(@Param("businessIds") List<Integer> businessIds);

    /**
     * 根据小二ids获取所有订单
     * @param courierIds
     * @return
     */
    List<Order> selectOrderByCourierIds(@Param("courierIds") List<Integer> courierIds);

    /**
     * 根据查询条件获取所有订单
     * @param orderVO
     * @return
     */
    List<Order> selectOrderByOrderVO(OrderVO orderVO);

    /**
     * 查询用于生成账单的订单集合
     * @param shopkeeperOrderVO
     * @param status
     * @return
     */
    List<Order> selectOrderToGenerate(@Param("shopkeeperOrderVO") ShopkeeperOrderVO shopkeeperOrderVO, @Param("status") List<Integer> status);
}